package core.rdd.example;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.List;

public class Spark02_AvgAge {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf()
                .setAppName("Spark01_HotTop10") // 应用名称
                .setMaster("local[*]"); // 替换成你的master地址
        JavaSparkContext jsc = new JavaSparkContext(conf);
        // 创建JavaSparkContext，它是与集群交互的主要入口点
        try {

            JavaRDD<String> stringJavaRDD = jsc.textFile("data/user.txt");


        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            jsc.close();
        }
    }
}
